<!--
 MIT License

 Copyright (c) 2020-2025 Ivo Steinbrecher

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
  -->
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script src="../js/CSInterface.js"></script>
        <script src="../js/jquery-3.7.1.min.js"></script>
        <script src="../js/auto_generated.js"></script>
        <script src="../js/common.js"></script>
        <script src="../js/main_item.js"></script>
        <link id="hostStyle" rel="stylesheet" href="../css/latex2ai.css" />

        <style>
            /* Container needed to position the button. Adjust the width as needed */
            .container {
                position: relative;
                width: 100pt;
            }

            .container img {
                width: auto;
                height: auto;
            }

            /* Style the button and place it in the middle of the container/image */
            /* 			-ms-transform: translate(-50%, -50%); */
            .container .item_placement {
                position: absolute;
                top: 100%;
                left: 100%;
                transform: translate(-50%, -50%);
                -ms-transform: translate(-50%, -50%);
                background-color: #555;
                color: white;
                font-size: 16px;
                padding: 12px 24px;
                border: none;
                cursor: pointer;
                border-radius: 5px;
            }

            .column1 {
                float: left;
                width: 20%;
            }
            .column2 {
                float: left;
                width: 57%;
            }
            .column3 {
                float: left;
                width: 23%;
            }

            /* Clear floats after the columns */
            .row:after {
                content: "";
                display: table;
                clear: both;
            }

            .button_half {
                width: 49%;
            }
            .button_full {
                width: 100%;
            }

            /* For vertical space */
            .bottom-three {
                margin-top: 2px;
                margin-bottom: 10px;
            }
        </style>
    </head>

    <body>
        <div class="row">
            <div class="column1">
                <p class="bottom-three">Placement</p>
            </div>
            <div class="column2">
                <p class="bottom-three" id="latex_code_title_text">
                    LaTeX code
                </p>
            </div>
        </div>
        <div class="row">
            <div class="column1">
                <div class="container">
                    <img id="item_placement_image" />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_top_left"
                        style="top: 3%; left: 0%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_top_centreH"
                        style="top: 3%; left: 50%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_top_right"
                        style="top: 3%; left: 100%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_centreV_left"
                        style="top: 51%; left: 0%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_centreV_centreH"
                        style="top: 51%; left: 50%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_centreV_right"
                        style="top: 51%; left: 100%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_baseline_left"
                        style="top: 70%; left: 0%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_baseline_centreH"
                        style="top: 70%; left: 50%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_baseline_right"
                        style="top: 70%; left: 100%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_bottom_left"
                        style="top: 98%; left: 0%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_bottom_centreH"
                        style="top: 98%; left: 50%"
                        checked
                    />
                    <input
                        type="radio"
                        class="item_placement"
                        name="item_placement"
                        id="placement_bottom_right"
                        style="top: 98%; left: 100%"
                        checked
                    />
                </div>
            </div>
            <div class="column2">
                <textarea
                    id="latex_text"
                    name="latex_text"
                    rows="8"
                    style="font-size: 11pt; width: 97%; resize: none"
                >
TeX code</textarea
                >
            </div>
            <div class="column3">
                <input
                    type="submit"
                    class="button_half"
                    id="button_ok"
                    value="OK"
                />
                <input
                    type="submit"
                    class="button_half"
                    id="button_cancel"
                    value="Cancel"
                />
                <br />
                <br />
                <input
                    type="submit"
                    class="button_full"
                    id="button_redo_latex"
                    value="Recompile LaTeX code"
                />
                <p id="boundary_box_state"></p>
                <input
                    type="submit"
                    class="button_full"
                    id="button_redo_boundary"
                    value="Reset scaling"
                />
            </div>
        </div>
    </body>
</html>
